<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文本审核</title>
</head>
<body>
<div id="content"></div>
<input type="text" name="string" id="string"/>
<button id="btn">提交</button>

<script>
    document.getElementById("btn").onclick =function () {
        let a = document.getElementById('string').value;
        let xmlHttp =new XMLHttpRequest();
        xmlHttp.onreadystatechange =function () {
            if(xmlHttp.readyState ==4 && xmlHttp.status ==200){
                document.getElementById("content").innerHTML=xmlHttp.responseText;
            }
        };
        xmlHttp.open("POST","text_form.php" ,true);
        xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        xmlHttp.send("string=" +a);
    }
</script>
</body>
</html>